//
//  FriendViewController.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/13.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "FriendViewController.h"
#import "FriendCell.h"


@interface FriendViewController ()

@end

@implementation FriendViewController

#pragma mark - lifecycle methods

- (void)setupUI{
    
    self.baseNavView.hidden = YES;
    self.view.backgroundColor = KWhiteColor;

}

- (void)setupLayout{
    
}

#pragma mark - networking methods
#pragma mark - response methods
#pragma mark - public methods

#pragma mark - tableview.delegate methods

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"点击tableView");
}

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}


-(NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    @weakify(self);
    UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
        @strongify(self);
        // [self deleteAddressRequestWithIndex:indexPath.row];
    }];
    return @[deleteAction];
}


#pragma mark - tableview.datascource methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 100;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    FriendCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FriendCell"];
    return cell;
}


#pragma mark - setter methods
#pragma mark - getter methods

- (void)registerTableViewCell
{
    [self.tableView registerClass:[FriendCell class] forCellReuseIdentifier:@"FriendCell"];
    self.tableView.rowHeight = 70;
    self.tableView.height = KScreenHeight - TJ_NavBarHeight;
    self.tableView.separatorColor = mIconLineColor;
    self.tableView.mj_footer.hidden = YES;
    self.tableView.mj_header.hidden = YES;
}

@end
